package com.apartmentManage.service.impl;

import com.apartmentManage.dao.ApartmentDao;
import com.apartmentManage.entity.Apartment;
import com.apartmentManage.service.AbsenceLogService;
import com.apartmentManage.service.ApartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ApartmentServiceImpl implements ApartmentService {

    @Autowired
    private ApartmentDao apartmentDao;
    @Override
    public List<Integer> getAllNo() {
            List<Integer> allNo=new ArrayList<>();
            List<Apartment> all = apartmentDao.getAll();
            for (int i=0;i<all.size();i++){
                if ( "是".equals(all.get(i).getStatus())){
                    allNo.add(all.get(i).getApartmentNo());
                }
            }
            return allNo;
        }
    }

